package com.example.admin.vo;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {
    private boolean success;

    private int code;

    private String msg;

    private Object data;

    /**
     * 返回结果
     *
     * @param data
     * @return
     */
    public static Result success(Object data) {
        return new Result(true, 200, "success", data);
    }

    public static Result fail(int code, Object data) {
        return new Result(false, code, "fail", null);
    }
}
